Skip to content

fix(agent): render the worker block with indent so long strings keep no newline - #566

Merged
sebastiancorrea81 merged 1 commit into
mainfrom
fix/agent-worker-values-folding
Sep 7, 2026
Merged

fix(agent): render the worker block with indent so long strings keep no newline#566
sebastiancorrea81 merged 1 commit into
mainfrom
fix/agent-worker-values-folding

Conversation

@agustincelentano

Copy link
Copy Markdown
Collaborator

Problem

nullplatform/agent/templates/nullplatform_agent_values.tmpl.yaml renders the worker block with

worker:
  %{ for line in split("\n", yamlencode(worker)) }
  ${line}
  %{ endfor }

Every iteration emits the line plus the template's own line break, so the rendered block has an empty line between every two lines. That is harmless for short values, but yamlencode folds strings longer than ~80 characters at a space (YAML double-quoted folding), and inside a folded scalar an empty line is a literal newline. A worker patch such as

command = ["sh", "-c", "wget -qO- https://github.com/nullplatform/scopes-networking/archive/refs/tags/v0.1.0.tar.gz | tar -xz --strip-components=1 -C /overrides"]

reaches the chart as wget -qO- https://…/v0.1.0.tar.gz\n| tar …: sh -c runs the wget alone and fails with a syntax error on the next line. Nothing surfaces in plan or apply; the failure shows up in the worker pod. Any worker.patches value with spaces past the fold width is affected (init container commands, args, env values with text).

Hit in production while mounting the scopes-networking overlay into the lambda worker via an init container.

Fix

Render the block with indent(2, yamlencode(worker)), which keeps the encoded lines contiguous. Output for every existing case is identical except for the removed blank lines.

Tests

New run long_worker_patch_strings_survive_rendering decodes the rendered values and asserts the long command comes back intact. It fails on main and passes with the fix; the module suite stays at 25/25.

…no newline

The template re-emitted yamlencode(worker) line by line, leaving an empty
line between every two lines. yamlencode folds strings longer than ~80
characters at a space, and inside a folded double-quoted scalar an empty
line is a literal newline, so a long patch command reached the chart split
in two without any plan or apply error. indent() keeps the block contiguous.
@agustincelentano
agustincelentano force-pushed the fix/agent-worker-values-folding branch from 39a3e26 to 4b06004 Compare September 7, 2026 18:46

@sebastiancorrea81 sebastiancorrea81 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sebastiancorrea81
sebastiancorrea81 enabled auto-merge (squash) September 7, 2026 18:48
@sebastiancorrea81
sebastiancorrea81 merged commit 1c838e5 into main Sep 7, 2026
53 checks passed
@sebastiancorrea81
sebastiancorrea81 deleted the fix/agent-worker-values-folding branch September 7, 2026 18:49
release-application Bot added a commit that referenced this pull request Sep 7, 2026
🤖 I have created a release *beep* *boop*
---


##
[7.4.1](v7.4.0...v7.4.1)
(2026-09-07)


### Bug Fixes

* **agent:** render the worker block with indent so long strings keep no
newline
([#566](#566))
([1c838e5](1c838e5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants